//
//  HZBaseRequest.h
//  httpDemo
//
//  Created by admin on 15/11/30.
//  Copyright © 2015年 admin. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "AFNetworking.h"
typedef NS_ENUM(NSInteger,HZRequestMethod){
    HZRequestMethodGet = 0,
    HZRequestMethodPost =1,
};

typedef NS_ENUM(NSInteger , HZRequestSerializerType) {
    HZRequestSerializerTypeJson = 0,
    HZRequestSerializerTypeHttp =1,
};
@interface HZBaseRequest : NSObject
@property(nonatomic,strong) AFHTTPRequestOperation * requestOperation;

//请求方法
@property(nonatomic) HZRequestMethod requestMethod;

//请求的参数
@property (nonatomic, strong) NSDictionary * requestParam;

//服务器地址的baseUrl
@property(nonatomic,strong) NSString * baseUrl;
//请求的url
@property(nonatomic,strong) NSString * requestUrl;
//返回的数据
/*
 待完善，json数据解析
 */
@property(nonatomic,strong,readonly) NSString * returnString;
@property(nonatomic,strong,readonly) NSDictionary * returnDictionary;
@property(nonatomic,strong,readonly) NSArray * returnArray;
@property(nonatomic,strong,readonly) NSData * returnData;
@property(nonatomic,strong,readonly) NSError * returnError;

@property(nonatomic) HZRequestSerializerType requestSerializerType;

//@property(nonatomic,copy) void(^failureCompetionBlock)(HZBaseRequest * ,BOOL isSuccess);

@property(nonatomic,copy) void(^successCompetionBlock)(HZBaseRequest * ,BOOL isSuccess);
@property(assign) NSInteger tag;

+(id)shareRequestInstance;
//状态码校验
- (BOOL)statusCodeValidator;

//把block置nil来打破循环引用
- (void)clearCompletionBlock;

- (void)stop;


@end
